<style type="text/css">
    #hr-trainningBatch-add {
        padding: 20px 25px 25px 0;
    }
</style>
<div class="layui-fluid" id="hr-trainningBatch-add">
    <form class="layui-form" action="" lay-filter="hr-trainningBatch-add-form">
        <div class="layui-form-item">
            <label class="layui-form-label febs-form-item-require">批次名称</label>
            <div class="layui-input-block">
                <input type="text" name="trainningName" minlength="2" maxlength="20" lay-verify="required|range|name|character|char"
                       autocomplete="off" class="layui-input repetitive" id="hr-trainningBatch-add-name">
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="remark" maxlength="200" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item febs-hide">
            <button class="layui-btn" lay-submit="" lay-filter="hr-trainningBatch-add-submit"
                    id="hr-trainningBatch-add-submit-btn"></button>
            <button type="reset" class="layui-btn" id="hr-trainningBatch-add-reset-btn"></button>
        </div>
    </form>
</div>

<script>
    layui.use(['febs', 'form', 'validate','upload'], function () {
        let $ = layui.$,
            febs = layui.febs,
            layer = layui.layer,
            form = layui.form,
            validate = layui.validate;
        form.verify(validate);
        form.render();
        form.on('submit(hr-trainningBatch-add-submit)', function (data) {
            // data.field为当前form表单的josn数据
            febs.post(ctx + 'trainningBatch/add', data.field, function () {
                layer.closeAll();
                febs.alert.success('新增院校成功');
                $('#hr-trainningBatch').find('#hr-trainningBatch-query-btn').click();
            });
            return false;
        });
    });
</script>